﻿Imports Mysoft.Map.Data

Partial Public Class Cwjk_PzRuleSet_SelectKjkm
    Inherits Mysoft.Map.Application.Security.AppPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Dim strCwztGUID, strCustomFilter, strKjkmGUID As String
            strCwztGUID = Request.QueryString("CwztGUID")
            strKjkmGUID = Request.QueryString("KjkmGUID")
            If Not strKjkmGUID Is Nothing AndAlso strKjkmGUID <> "" Then
                Me.txtKjkmOrderCode.Text = MyDB.GetDataItemString("SELECT KjkmOrderCode FROM p_CwjkKjkm WHERE KjkmGUID = '" & strKjkmGUID & "'")
            End If
            If Not strCwztGUID Is Nothing AndAlso strCwztGUID <> "" Then
                strCustomFilter = "b.CwztGUID = '" & strCwztGUID & "'"
            Else
                strCustomFilter = " 1=2 "
            End If
            appGridTree.CustomFilter = strCustomFilter
            Dim iLength As Integer = MyDB.GetDataItemInt("SELECT ISNULL(Max(KjkmLevel),0) AS KjkmLevel FROM p_CwjkKjkm WHERE CwztGUID = '" & strCwztGUID & "' AND (ObjectType=1 or ( IsEnd=1 AND ObjectType=0 ) )")
            '设置级数
            Dim strLevelHtml As String = ""
            Dim i As Int32
            For i = 1 To iLength
                strLevelHtml = strLevelHtml & "<a href='javascript:appGridTree.showLevel(" & i & ")' style='color:white;text-decoration: none' >&nbsp;" & i & "&nbsp;</a>"
            Next
            sHtml.Value = strLevelHtml
        End If
    End Sub

End Class